<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Disable the ability to load external entities</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.libxml-clear-errors.html">« libxml_clear_errors</a></li>
      <li style="float: right;"><a href="function.libxml-get-errors.html">libxml_get_errors »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.libxml.html">libxml 函数</a></li>
    <li>Disable the ability to load external entities</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.libxml-disable-entity-loader" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">libxml_disable_entity_loader</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.11, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">libxml_disable_entity_loader</span> &mdash; <span class="dc-title">Disable the ability to load external entities</span></p>

 </div>

 <div id="function.libxml-disable-entity-loader-refsynopsisdiv">
   <div class="warning"><strong class="warning">警告</strong><p class="simpara">本函数已自 PHP 8.0.0
 起被<em class="emphasis">废弃</em>。强烈建议不要依赖本函数。</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-function.libxml-disable-entity-loader-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>libxml_disable_entity_loader</strong></span>(<span class="methodparam"><span class="type">bool</span> <code class="parameter">$disable</code><span class="initializer"> = <strong><code>true</code></strong></span></span>): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   Disable/enable the ability to load external entities.
   Note that disabling the loading of external entities may cause general issues
   with loading XML documents. However, as of libxml 2.9.0 entity substitution
   is disabled by default, so there is no need to disable the loading of external
   entities,
   unless there is the need to resolve internal entity references with <strong><code>LIBXML_NOENT</code></strong>.
   Generally, it is preferable to use <span class="function"><a href="function.libxml-set-external-entity-loader.html" class="function">libxml_set_external_entity_loader()</a></span>
   to suppress loading of external entities.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.libxml-disable-entity-loader-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">disable</code></dt>

     <dd>

      <p class="para">
       Disable (<strong><code>true</code></strong>) or enable (<strong><code>false</code></strong>) libxml extensions (such as
       <a href="book.dom.html" class="xref">DOM</a>, <a href="book.xmlwriter.html" class="xref">XMLWriter</a>
       and <a href="book.xmlreader.html" class="xref">XMLReader</a>) to load external entities.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.libxml-disable-entity-loader-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the previous value.
  </p>
 </div>






 <div class="refsect1 seealso" id="refsect1-function.libxml-disable-entity-loader-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.libxml-use-internal-errors.html" class="function" rel="rdfs-seeAlso">libxml_use_internal_errors()</a> - Disable libxml errors and allow user to fetch error information as needed</span></li>
    <li class="member"><span class="function"><a href="function.libxml-set-external-entity-loader.html" class="function" rel="rdfs-seeAlso">libxml_set_external_entity_loader()</a> - Changes the default external entity loader</span></li>
    <li class="member"><a href="libxml.constants.html" class="link">The <strong><code>LIBXML_NOENT</code></strong> constant</a></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>